import request from "@/api";
import { BaseRet, ListRet } from "@/api/response";
import { AddChatFriend, ChatFriend } from "./model";

class ChatFriendApi {
  /**
   * 查询好友
   * @param data
   * @returns
   */
  static async query(): Promise<ListRet<ChatFriend>> {
    return await request({
      url: "ChatFriend/GetChatFriendList",
      method: "get",
    });
  }
  /**
   * 新增好友
   * @param data
   * @returns
   */
  static async create(friend: AddChatFriend): Promise<BaseRet> {
    return await request({
      url: "ChatFriend/Create",
      method: "post",
      data: friend,
    });
  }
}

export default ChatFriendApi;
